package com.battery.system.service;

import java.util.List;
import java.util.Map;

import com.battery.common.core.domain.AjaxResult;
import com.battery.common.utils.ali.AliPayEntity;
import com.battery.system.domain.BO.RefundApplyBO;
import com.battery.system.domain.RefundApply;
import com.battery.system.domain.VO.RefundApplyVO;

/**
 * 订单退款申请Service接口
 *
 * @author battery
 * @date 2021-03-12
 */
public interface IRefundApplyService extends IBaseService<RefundApply> {
    /**
     * 查询订单退款申请
     *
     * @param id 订单退款申请ID
     * @return 订单退款申请
     */
    public RefundApply selectRefundApplyById(String id);

    /**
     * 查询订单退款申请列表
     *
     * @param refundApply 订单退款申请
     * @return 订单退款申请集合
     */
    public List<RefundApply> selectRefundApplyList(RefundApply refundApply);

    /**
     * 新增订单退款申请
     *
     * @param refundApply 订单退款申请
     * @return 结果
     */
    public int insertRefundApply(RefundApply refundApply);

    /**
     * 修改订单退款申请
     *
     * @param refundApply 订单退款申请
     * @return 结果
     */
    public int updateRefundApply(RefundApply refundApply);

    /**
     * 批量删除订单退款申请
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteRefundApplyByIds(String ids);

    /**
     * 删除订单退款申请信息
     *
     * @param id 订单退款申请ID
     * @return 结果
     */
    public int deleteRefundApplyById(String id);

    List<RefundApply> selectRefundApplyByPartner(Map<String, String> map);

    /**
     * 退款申请列表
     *
     * @param refundApplyBO
     * @return
     */
    List<RefundApplyVO> selectRefundApplyVOList(RefundApplyBO refundApplyBO);


    /**
     * 通过并进行退款操作
     *
     * @param refundApplyId
     * @param aliPayEntity
     * @return
     */
    AjaxResult adoptRefund(String refundApplyId, AliPayEntity aliPayEntity);

    /**
     * 根据租借记录ID查询对应的退款申请信息
     *
     * @param usedId
     * @return
     */
    boolean selectCountByUsedId(String usedId);

    /**
     * \
     * 根据租借记录ID查询对应的退款信息
     *
     * @param usedId
     * @return
     */
    RefundApply selectOneByUsedId(String usedId);
}
